
/**
 * 获取自定义报表options
 * @returns 
 */
export const getCustomChartOptions = ({ title, legendData, xAxisData, series },themeName) => {
    const options = {
        backgroundColor: 'rgba(0,0,0,0)',
        color: ['#50D3ED', '#FF9100', '#FA344B', '#22BB00', '#00DCFD'],
        tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
			},
		},
        title: {
            text: title,
            textStyle:{
                color: themeName!='white'?'#fff':'#333',
                fontStyle: 'normal',
                fontWeight: 'normal',
                fontFamily: 'sans-serif',
                fontSize: 12
            }
        },
        tooltip: {
            trigger: "axis",
        },
        legend: {
            data: legendData,
            right: 10,
            top: 10,
            itemWidth: 8,  
            itemHeight: 8,      
            icon: 'rect',
            textStyle: {
                color: themeName!='white'?'#fff':'#333',
                fontSize: 12
            }
            
        },
        grid: {
            left: '70',
            x: 50,
            y: 50,
            x2: 50,
            y2: 50,
            show: false,    
        },
        toolbox: {
			show: false,
			orient: "vertical",
			left: "right",
			top: "center",
			feature: {
				mark: { show: true },
				dataView: { show: true, readOnly: false },
				magicType: { show: true, type: ["line", "bar", "stack"] },
				restore: { show: true },
				saveAsImage: { show: true },
			},
		},
        xAxis: {
            type: "category",
            axisLine: {
                show: true,    // 是否显示坐标轴轴线
                lineStyle: {
                    color: 'rgba(255,255,255,0.3)',    // 坐标轴线线的颜色
                    type: 'solid',    // 坐标轴线线的类型（solid实线类型；dashed虚线类型；dotted点状类型）
                    opacity:0.18,
                },
            },
            axisTick:{
                show: true,  // 是否显示坐标轴刻度线
                textStyle: {
                    color: '#ccc'
                },
                lineStyle:{
                    opacity:0.18,
                }
            },
            axisLabel: {
                show: true,  // 是否显示坐标轴刻度线
                // rotate: 40,
                textStyle: {
                    color: '#ccc'
                }
            },
            splitLine:{
                show: false // 是否显示网格线
            },
            data: xAxisData,
        },
        yAxis: {
            type: "value",
            axisLine: {
                show: true,    // 是否显示坐标轴轴线
                lineStyle: {
                    color: 'rgba(255,255,255,0.3)',    // 坐标轴线线的颜色
                    type: 'solid',    // 坐标轴线线的类型（solid实线类型；dashed虚线类型；dotted点状类型）
                    opacity:0.18,
                },
            },
            axisLabel: {
                show: true,  // 是否显示坐标轴刻度线
                textStyle: {
                    color: '#ccc'
                }
            },
            axisTick:{
                lineStyle:{
                    opacity:0.18,
                }
            },
            splitLine:{
                show: true, // 是否显示网格线
                lineStyle: {
                    color: '#302F2B',
                    type: 'dashed',
                    opacity:0.18,
                }
            },
        },
        series
    };
    
    return options;
};
